import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
const history = createWebHistory()
const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "layout",
    component: () => import("../layout/index.vue"),
    children: [
      {
        path: "/",
        redirect: "/shop",
      },
      {
        path: "/shop",
        name: "shop",
        component: () => import("../views/shop/index.vue"),
      },
      {
        path: "/order",
        name: "order",
        component: () => import("../views/order/index.vue"),
      },
      {
        path: "/commodity",
        name: "commodity",
        component: () => import("../views/commodity/index.vue"),
      },
      {
        path: "/orderDetail",
        name: "orderDetail",
        component: () => import("../views/order/modules/detail.vue"),
      },
      {
        path: "/shopAdd",
        name: "shopAdd",
        component: () => import("../views/commodity/add.vue"),
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login/login.vue"),
  },
];
const router = createRouter({
      history,
      routes
})
export default router
